﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IncentiveClosing.aspx.cs"
    Inherits="sWarranty.WEB.IncentiveClosing" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="../UC/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../CSS/table.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/Menu.css" />
    <link href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" rel="stylesheet"
        type="text/css" />
    <script src="../JS/jquery-1.8.2.js" type="text/javascript"></script>
    <script src="../JS/Menu.js" type="text/javascript"></script>
    <script src="../JS/jquery-ui.js" type="text/javascript"></script>
    <script src="../JS/notify.js" type="text/javascript"></script>
    <link href="../CSS/notify.css" rel="stylesheet" type="text/css" />
    <link href="../JS/chosen-master/chosen/chosen.css" rel="stylesheet" type="text/css" />
    <script src="../JS/chosen-master/chosen/chosen.jquery.js" type="text/javascript"></script>
    <script type='text/javascript'>
        $(document).ready(function () {
            $("#txtStartDate").datepicker({ dateFormat: 'yy-mm-dd' });
            $("#txtEndDate").datepicker({ dateFormat: 'yy-mm-dd' });

            $("#txtInputFind").keypress(function (event) {
                if (event.which == 13) {
                    event.preventDefault();
                    var sch = document.getElementById("txtSchemeIDHiden").value;
                    var mol = document.getElementById("txtInputFind").value;
                    __doPostBack("btnAsp", sch);
                }
            });
            SetLogger();
        });

        function FindBySchemeAndModel() {
            var m = $("#txtInputFind").val();
            var s = document.getElementById("schemeID").value;
            if (s != "") {
                var options = {
                    type: 'POST',
                    url: 'WebService1.asmx/FindBySchemeAndModel ',
                    data: '{schemeID: "' + s + '", model: "' + m + '"}',
                    contentType: 'application/json; charset=utf-8',
                    dataType: 'json',
                    success: function (data) {
                        if (data != '') {
                            $("#divListModel").html(data.d);
                        }
                    },
                    error: function (e) {
                    }
                };
                $.ajax(options);
            }
        }
        function listModel(schemeID) {
            $("#divListModel").html(""); schemeID
            var s = document.getElementById("schemeID");
            s.value = "";
            $('#imgLoading' + schemeID).show();
            var options = {
                type: 'POST',
                url: 'WebService1.asmx/listModelByScheme ',
                data: '{schemeID: "' + schemeID + '"}',
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                success: function (data) {
                    if (data != '') {
                        $("#divListModel").html(data.d);
                        $('#imgLoading' + schemeID).hide();
                        s.value = schemeID;
                    }
                },
                error: function (e) {
                    $('#imgLoading' + schemeID).hide();
                    s.value = "";
                }
            };
            $.ajax(options);
        }

        $(function () {
            //$("table").tablesorter({ debug: false });
            //.tablesorterPager({ container: $("#pager") }); 
        });
        function openPopUp(popUrl, type) {
            var name = 'popUp';
            var appearence = 'dependent=no,menubar=no,resizable=yes,scrollbars=1,' +
                  'status=yes,toolbar=yes,titlebar=no,width=' + window.screen.availWidth * 80 / 100 + ', height=' + window.screen.availHeight * 80 / 100 + ',resizable:yes,center:yes';
            var openWindow = '';
            if (type == 'open')
                openWindow = window.open(popUrl, name, appearence);
            if (type == 'popup')
                openWindow = window.showModalDialog(popUrl, name, appearence);
            openWindow.focus();
        }

    </script>
    <style>
        .search
        {
            padding: 1px 1px 1px 20px; /*margin: 3px;*/
            background: url('../images/Search-icon.png') no-repeat 1.5px 1.5px;
        }
        .rounded
        {
            border-radius: 15px;
            -moz-border-radius: 15px;
            -webkit-border-radius: 15px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ksdjfl" runat="server">
    </asp:ScriptManager>
    <uc1:Header ID="Header1" runat="server" />
    <div class="Mid">
        <div class="Mid1">
            <div id="DataContent">
                <%-- <div>
                    Nội dung bên trái
                </div>--%>
                <div>
                    <div id="divCreate" style="width: 100%">
                        <div class="TitleCont">
                            <asp:Label ID="lblTitle" runat="server" Text="Scheme Closing"></asp:Label>
                            <img id='imgLoadingxyz' src='../images/oader-grey.gif' style='display: none' />
                        </div>
                        <!-- DataGrid Start -->
                        <div class="Mid2">
                            <div class="Search2">
                                <table id="newspaper-b">
                                    <tbody>
                                        <tr>
                                            <td class="BackGround-gray">
                                                From
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="dropYearFrom" runat="server" Width="50%" CssClass="chzn-select"
                                                    data-placeholder="..Year..">
                                                    <asp:ListItem Value="2012" Text="2012"></asp:ListItem>
                                                    <asp:ListItem Value="2013" Text="2013"></asp:ListItem>
                                                    <asp:ListItem Value="2014" Text="2014"></asp:ListItem>
                                                    <asp:ListItem Value="2015" Text="2015"></asp:ListItem>
                                                    <asp:ListItem Value="2016" Text="2016"></asp:ListItem>
                                                    <asp:ListItem Value="2017" Text="2017"></asp:ListItem>
                                                    <asp:ListItem Value="2018" Text="2018"></asp:ListItem>
                                                    <asp:ListItem Value="2019" Text="2019"></asp:ListItem>
                                                    <asp:ListItem Value="2020" Text="2020"></asp:ListItem>
                                                </asp:DropDownList>
                                                <asp:DropDownList ID="dropMonthFrom" runat="server" Width="50%" CssClass="chzn-select"
                                                    data-placeholder="..Month..">
                                                    <asp:ListItem Value="01" Text="JAN"></asp:ListItem>
                                                    <asp:ListItem Value="02" Text="FEB"></asp:ListItem>
                                                    <asp:ListItem Value="03" Text="MAR"></asp:ListItem>
                                                    <asp:ListItem Value="04" Text="APR"></asp:ListItem>
                                                    <asp:ListItem Value="05" Text="MAY"></asp:ListItem>
                                                    <asp:ListItem Value="06" Text="JUN"></asp:ListItem>
                                                    <asp:ListItem Value="07" Text="JUL"></asp:ListItem>
                                                    <asp:ListItem Value="08" Text="AUG"></asp:ListItem>
                                                    <asp:ListItem Value="09" Text="SEP"></asp:ListItem>
                                                    <asp:ListItem Value="10" Text="OCT"></asp:ListItem>
                                                    <asp:ListItem Value="11" Text="NOV"></asp:ListItem>
                                                    <asp:ListItem Value="12" Text="DEC"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td class="BackGround-gray">
                                                Scheme
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="dropScheme" runat="server" Width="100%" CssClass="chzn-select">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="BackGround-gray">
                                                To
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="dropYearTo" runat="server" Width="50%" CssClass="chzn-select"
                                                    data-placeholder="..Year..">
                                                    <asp:ListItem Value="2012" Text="2012"></asp:ListItem>
                                                    <asp:ListItem Value="2013" Text="2013"></asp:ListItem>
                                                    <asp:ListItem Value="2014" Text="2014"></asp:ListItem>
                                                    <asp:ListItem Value="2015" Text="2015"></asp:ListItem>
                                                    <asp:ListItem Value="2016" Text="2016"></asp:ListItem>
                                                    <asp:ListItem Value="2017" Text="2017"></asp:ListItem>
                                                    <asp:ListItem Value="2018" Text="2018"></asp:ListItem>
                                                    <asp:ListItem Value="2019" Text="2019"></asp:ListItem>
                                                    <asp:ListItem Value="2020" Text="2020"></asp:ListItem>
                                                </asp:DropDownList>
                                                <asp:DropDownList ID="dropMonthTo" runat="server" Width="50%" CssClass="chzn-select"
                                                    data-placeholder="..Month..">
                                                    <asp:ListItem Value="01" Text="JAN"></asp:ListItem>
                                                    <asp:ListItem Value="02" Text="FEB"></asp:ListItem>
                                                    <asp:ListItem Value="03" Text="MAR"></asp:ListItem>
                                                    <asp:ListItem Value="04" Text="APR"></asp:ListItem>
                                                    <asp:ListItem Value="05" Text="MAY"></asp:ListItem>
                                                    <asp:ListItem Value="06" Text="JUN"></asp:ListItem>
                                                    <asp:ListItem Value="07" Text="JUL"></asp:ListItem>
                                                    <asp:ListItem Value="08" Text="AUG"></asp:ListItem>
                                                    <asp:ListItem Value="09" Text="SEP"></asp:ListItem>
                                                    <asp:ListItem Value="10" Text="OCT"></asp:ListItem>
                                                    <asp:ListItem Value="11" Text="NOV"></asp:ListItem>
                                                    <asp:ListItem Value="12" Text="DEC"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td class="BackGround-gray">
                                                Purpose
                                            </td>
                                            <td>
                                                <asp:TextBox ID='txtPurpose' runat="server" Width="80%"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="BackGround-gray">
                                                End Date<span style="color: Red;">*</span>
                                            </td>
                                            <td>
                                                <asp:TextBox ID='txtEndDate' ClientIDMode="Static" runat="server" Width="80%"></asp:TextBox>
                                            </td>
                                            <td class="BackGround-gray">
                                                &nbsp;
                                            </td>
                                            <td>
                                                <asp:CheckBox ID="chkEnable" runat="server" Text="Enable" Visible="False" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="BackGround-gray" colspan="4">
                                                <asp:Button ID="btnSave" runat="server" CssClass="button Float-right" Text="Save"
                                                    Width="80px" OnClick="btnSave_Click" />
                                                <asp:Label ID="lblError" runat="server" Visible='false'></asp:Label>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <!-- DataGrid End -->
                            </div>
                        </div>
                        <div class="Clear_both">
                        </div>
                    </div>
                    <div class="TitleCont">
                        Scheme Information
                    </div>
                    <div id="xxx" style="height: 100%; overflow: auto;">
                        <!-- DataGrid Start -->
                        <table id="newspaper-b">
                            <thead>
                                <tr>
                                    <th scope="col">
                                        #
                                    </th>
                                    <th scope="col">
                                        SCHEME_ID
                                    </th>
                                    <th scope="col">
                                        SCHEME_NAME
                                    </th>
                                    <th scope="col">
                                        REGION
                                    </th>
                                    <th scope="col">
                                        START_DATE
                                    </th>
                                    <th scope="col">
                                        END_DATE
                                    </th>
                                    <th scope="col">
                                        PURPOSE
                                    </th>
                                    <th scope="col">
                                        Import Model
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <asp:Literal ID="litData" runat="server"></asp:Literal>
                            </tbody>
                        </table>
                    </div>
                    <div class="TitleCont" style="padding-top: 15px;">
                        Scheme Detail
                        <tr style="background: gray;">
                            <asp:TextBox ID="txtSchemeIDHiden" runat="server" ClientIDMode="Static" Style="display: none;" />
                            <span><input id="txtInputFind" runat='server' type="text" class="search rounded" style="float: right;"></span>
                            <span style="float: right;">Find by Model: &nbsp; </span>
                        </tr>
                        <%-- <tr style="background: gray;">
                            <td class="BackGround-gray">
                                <input type="text" style="width: 200px; border: 1 solid gray; float: right;" />
                            </td>
                        </tr>--%>
                    </div>
                    <div id="divGridContainer" runat="server">
                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
                            Skin="Office2007" CssClass="RadGridCustomClass" GridLines="Both" ShowGroupPanel="false"
                            OnNeedDataSource="RadGrid1_NeedDataSource" OnColumnCreated="RadGrid1_ColumnCreated">
                            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="false" ReorderColumnsOnClient="True">
                            </ClientSettings>
                            <MasterTableView>
                                <PagerStyle AlwaysVisible="True" />
                                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                        </telerik:RadGrid>
                    </div>
                    <span id="span1" runat="server" style="display: none"></span>
                </div>
            </div>
            <div class="Clear_both">
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(".chzn-select").chosen();
    </script>
    </form>
</body>
</html>
